programming4us
           
 
 
SQL Server

Microsoft SQL Server 2008 R2 : Setting Up Replication (part 1) - Creating a Distributor and Enabling Publishing

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/14/2011 9:20:21 AM
In general, SQL Server 2008 data replication is exceptionally easy to set up via SQL Server Management Studio wizards. However, if you use the wizards, you need to be sure to generate SQL scripts for every phase of replication configuration. In a production environment, you are likely to rely heavily on scripts and not have the luxury of having much time to set up and break down production replication configurations via wizards. Generating SQL scripts also eases the setup/breakdown process in development, test, and user acceptance environments.

You always have to define any data replication configuration in the following order:

1.
Create or enable a distributor to enable publishing.

2.
Enable publishing. (A distributor must be designated for a publisher.)

3.
Create a publication and define articles within the publication.

4.
Define subscribers and subscribe to a publication.

Figure 1 shows SQL Server Management Studio Object Explorer with three separate server connections. These three servers represent a possible replication topology.

Figure 1. Three servers to be used in the replication topology (central publisher, remote distributor, and subscriber).

The following section takes you through the process of building up a typical central publisher/remote distribution data replication configuration. The following SQL Server named instances are used for different purposes (as shown in Figure 1):

  • Publisher— A SQL08DE01 named instance

  • Distributor— A SQL08DE02 named instance (REMOTE distributor)

  • Subscriber— A SQL08DE03 named instance

The following section highlights the different areas in SQL Server Management Studio that are needed to create this replication configuration.

Creating a Distributor and Enabling Publishing

Before setting up a publisher, you have to designate a distribution server to be used by that publisher. As discussed earlier, you can either configure the local server as the distribution server or choose a remote server as the distributor (not on the same machine as the publication server). You can configure the server as a distributor and publisher at the same time, or you can configure the server as a dedicated distributor on the remote server separately. In the sample topology described here, you start by creating a remote distributor separately so you can orient yourself to what is happening on each server in the topology as it is being built up. You are also able to enable a specific SQL Server instance as the publisher that will use this distributor (all in one wizard sequence). This method is very efficient.

Before you can configure replication, you must be a member of the sysadmin server role, so you should ensure that now. Then you use the following steps to configure a server as a distributor (remote distributor):

1.
In SQL Server Management Studio, locate the Replication node under the server that will be the distributor (under the SQL08DE02 named instance node). Right-click the Replication node and choose Configure Distribution. This starts you through the wizard, which provides three options:

  • Configure this server to be a distributor.

  • Configure this server to be both a publisher and distributor.

  • Configure this server to be a publisher that uses another server as its distributor.

2.
When the wizard starts, click past the initial Configure Distribution Wizard splash page. Then choose the first radio button, which should say ‘DBARCH-LT2\SQL08DE02’ Will Act as Its Own Distributor (as shown in Figure 2). This designates this server as a distributor for one or more publishers. The distribution database and log are created here as well (and not on the publication server).

Figure 2. Configuring a separate distributor (REMOTE) wizard.


3.
You are then asked how you want the replication agents to be started. Select the agents to be started automatically (the Yes option).

4.
Next comes the location for the snapshot folder. Give it the proper network full pathname. Remember that potentially a large amount of data will be coming here, and it should be on a drive that can support the snapshot concept without filling up the drive.

5.
When you are asked to configure the distribution database, select the default settings. Figure 3 shows all the distribution database name and location information.

Figure 3. Specification of the distribution database name and location.

6.
Identify the publisher if you know which SQL Server instance will be publishing the data that this distributor will distribute for. To do this, click the Add button at the bottom-left corner of the Publishers page to enable servers to use this distributor when they become publishers. You are prompted for the server name and authentication method for the distributor to reach this publisher. Specify DBARCH-LT2\SQL08DE01 as a publisher that will use this distributor. The end result, as shown in Figure 4, is DBARCH-LT2\SQL08DE01 designated (checked) as a publisher that will use this distribution database (distributor). Remember to uncheck the SQL Server named instance of the distribution server if you don’t want to publish from that server (the SQL08DE02 named instance).

Figure 4. Designate the publisher that will use this remote distributor.

7.
Specify a distributor password. This is the password that will be used by publishers to connect to the distributor. You will be able to administer this password through SQL Server Management Studio directly. The wizard then summarizes what actions you want to take place, such as configure the distribution server or generate a script file with steps to configure distribution. Choose both. It’s always good to have the scripts created now so you can start script-based configurations immediately. A Complete the Wizard page is displayed, describing all the tasks that are about to happen, along with their configuration specifications. Figure 5 show this summary.

Figure 5. Completing the configuration of the distributor and enabling the publisher.

When you click Finish, several things begin to occur. First, a configuring dialog page comes up and spins its wheels through each step you have requested (as shown in Figure 6). A summary of steps, errors, and warnings is displayed on this page. When it completes, you can explore any issues (errors or warnings) by drilling down in the Report option (lower-right side of this dialog). Make sure you see Success after each step of this configuration.

Figure 6. Configuring the distributor and enabling a publisher in progress.

Now is probably a good time to locate that distributor setup and enabling publication script and drop it into your replication administrator folder that you keep in a safe place. Figure 7 shows what this script looks like. Notice that the password is not displayed.

Figure 7. The script generated for creating the distributor and enabling a publisher.

When the distributor is configured and the distribution database is created, a series of replication agents (managed by SQL Server Agent) are created, with various duties. Figure 8 shows the initial set of agents created on the distribution server (as seen from the Job Activity Monitor under the SQL Server Agent). No agents exist yet that actually publish data or distribute data. Those agents are created later, as you start publishing and subscribing.

Figure 8. Initial replication agents on the distributor.
Other -----------------
- SQL Server 2008 R2 : Basing the Replication Design on User Requirements
- SQL Server 2008 R2 : Planning for SQL Server Data Replication & SQL Server Replication Types
- SQL Server 2008 R2 : Replication Agents
- SQL Server 2008 : Replication - Subscriptions
- SQL Server 2008 : Replication Scenarios
- Protecting SQL Server Data : CELL-LEVEL ENCRYPTION - Special Considerations
- Protecting SQL Server Data : SCHEMA ARCHITECTURE STRATEGIES - Harnessing Linked Servers
- Monitoring SQL Server 2005 Performance : Using Windows System Monitor & Using SQL Server Profiler
- Monitoring SQL Server 2005 Performance : Monitoring and Recording Performance
- SQL Server 2008 R2 : Replication - The Publisher, Distributor, and Subscriber Magazine Metaphor
- SQL Server 2008 R2 : Replication - What Is Replication?
- SQL Server 2008 High Availability : Other HA Techniques That Yield Great Results & High Availability from the Windows Server Family Side
- SQL Server 2008 High Availability : Building Solutions with One or More HA Options
- SQL Server 2008 High Availability : The Fundamentals of HA
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 4)
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 3) - Performing a Database Backup
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 2) - Common OS-Related Tasks
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 1) - General Tasks & Scheduling Scripts
- PowerShell in SQL Server 2008
- Protecting SQL Server Data : SCHEMA ARCHITECTURE STRATEGIES - Using Database Object Schemas
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us